<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html 
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">


    <h:head>
        <title>IPTU</title>

    </h:head>
    <h:body>
        <style>
            .ui-datatable .ui-column-filter {
                display: block;
                margin: auto;
                width: 90%;
            }
        </style>
        <h:form prependId="false">

        </h:form>

        <h:form id="conForm" >

            <p:panel id="resultPanel" >

                <h1>#{managerImovel.count}</h1>
                <p:dataTable var="b" value="#{managerImovel.lstImovel}" 
                             rows="15" paginator="true"  
                             paginatorPosition="bottom"
                             filteredValue="#{managerImovel.imovelfilter}"
                             emptyMessage="Nenhum registro">  
                    <f:facet name="header">
                        BCI
                    </f:facet>
                    <p:column headerText="ID">  
                        <h:outputText value="#{b.id}"/>
                    </p:column>  
                    <p:column rendered="false" headerText="Pendência" width="10" style="white-space: pre-wrap;">  
                        <h:outputText value="CPF incorreto" 
                                      rendered="#{b.codigoDoContribuinte.cpfOuCnpj.length() le 11 ? true:false}"/>
                    </p:column>
                    <p:column headerText="Contribuinte" width="300" style="white-space: pre-wrap;" 
                              filterBy="#{b.codigoDoContribuinte.nome}" filterMatchMode="startsWith">  
                        <h:outputText value="#{b.codigoDoContribuinte.nome}"/>
                    </p:column>
                    <p:column headerText="CPF" width="50" style="white-space: pre-wrap;" 
                              filterBy="#{b.codigoDoContribuinte.cpfOuCnpj}" filterMatchMode="startsWith">  
                        <h:outputText value="#{b.codigoDoContribuinte.cpfOuCnpj}"/>
                    </p:column>
                    <p:column headerText="Logradouro" style="white-space: pre-wrap;" 
                              filterBy="#{b.codigoLogradouro.nomeLogradouro}" filterMatchMode="startsWith" >  
                        <h:outputText value="#{b.codigoLogradouro.nomeLogradouro}"/>
                    </p:column>
                    <p:column headerText="Nº" width="50" filterBy="#{b.numero}" filterMatchMode="startsWith">  
                        <h:outputText value="#{b.numero}"/>
                    </p:column>
                    <p:column headerText="Bairro" filterBy="#{b.codigoDoBairro.nomeDoBairro}" filterMatchMode="contains">  
                        <h:outputText value="#{b.codigoDoBairro.nomeDoBairro}"/>
                    </p:column>
                    <p:column rendered="false" headerText="vvt" filterBy="#{b.iptu.vvt}" filterMatchMode="contains">  
                        <h:outputText value="#{b.iptu.vvt}"/>
                    </p:column>
                    <p:column rendered="false" headerText="vve" filterBy="#{b.iptu.vve}" filterMatchMode="contains">  
                        <h:outputText value="#{b.iptu.vve}"/>
                    </p:column>
                    <p:column rendered="false" headerText="vvi" filterBy="#{b.iptu.vvi}" filterMatchMode="contains">  
                        <h:outputText value="#{b.iptu.vvi}"/>
                    </p:column>
                    <p:column rendered="true" width="40" style="white-space: pre-wrap;"  headerText="Alteracoes" >  
                        <h:outputText value="Piso|" rendered="#{b.codigoPisoAntigo ne null}"/>
                        <h:outputText value="Cobertura|" rendered="#{b.codigoDaCoberturaAntigo ne null}"/>
                        <h:outputText value="Estrutura|" rendered="#{b.codigoDaEstruturaAntigo ne null}"/>
                        <h:outputText value="Inst. Sanitaria|" rendered="#{b.codigoInstSanitariaAntigo ne null}"/>
                        <h:outputText value="Construção|" rendered="#{b.codigoTipoConstrucaoAntigo ne null}"/>
                        <h:outputText value="Rev. Externo|" rendered="#{b.codRevestimentoAntigo ne null}"/>
                    </p:column>
                    <p:column rendered="true" headerText="valor" filterBy="#{b.iptu.valorBaseCorrigido}" filterMatchMode="contains">  
                        <h:outputText value="#{b.iptu.valorBaseCorrigido}"/>
                    </p:column>
                    <p:column rendered="true" headerText="valor" filterBy="#{b.iptuNovo.valorBaseCorrigido}" filterMatchMode="contains">  
                        <h:outputText value="#{b.iptuNovo.valorBaseCorrigido}"/>
                    </p:column>
                    


                </p:dataTable>

            </p:panel>
        </h:form>
    </h:body>
</html>